/**
 * Created by yiba0104 on 2017/5/9.
 */
var Array = require('node-array');

var a = [ 1, 2, 3, 4, 5 ];

a.forEachAsync(function(element, index, arr, next) {
    console.log(element);

    // continue after one second
    setTimeout(function() {

        // Use next() to continue
        next();
    }, 1000);

    return true;
}, function() {
    console.log('complete');
});

//a.forEach(function(element, index) {
//    setTimeout(function() {
//
//        console.log(element);
//    }, 1000);
//})